$(function () {
	// 防止当前没处于顶层框架
	if (window.top != window) {
		window.location.href = "index/welcome";
		return ;
	}
	$("body").show();
	
	// 动态改变iframe大小
	var resize = function () {
		var height = document.body.offsetHeight
		var indexHeight = height - $(".default-theme .nav-info").outerHeight(true);
		$("#index").css("height", indexHeight + "px");
		
		height = $("#index").outerHeight(true);
		var iframeHeight = height - $("#content .nav-tabs").outerHeight(true);
		$("#content .tab-content").css("height", iframeHeight + "px");
	};
	
	resize();
	$(window).resize(function () {
		resize();
	});
	
	$("#menu .panel-body a").click(function () {
		var url = $(this).attr("href");
		var title = $(this).html();
		
		tabUtil.add(url, title);
		return false;
	});
});